<?php
/**
 * Created by PhpStorm.
 * User: xutao
 * Date: 2018/8/1
 * Time: 18:23
 */
namespace app\index\validate;
use think\Validate;

class MemberValidate extends Validate{
    protected $rule = [
        'name'  =>  'require|max:25',
        'nickname'  =>  'require|max:25',
        'birthday'  =>  'date',
        'city'  =>  'require',
        'email' =>  'email',
        'phone'=>'require|max:11|/^1[3-8]{1}[0-9]{9}$/',
//        'pwd'=>'require'
    ];
    protected $message  =   [
        'name.require' => '名称必须',
        'name.max'     => '名称最多不能超过25个字符',
        'nickname.require' => '昵称必须',
        'nickname.max'     => '昵称最多不能超过25个字符',
        'birthday.date'   => '生日为日期',
        'city.require'  => '居住城市不能为空',
        'email.email'        => '邮箱格式错误',
        'phone.require'     => '电话不能为空',
        'phone.max' =>'电话格式错误',
    ];
}